#include <stdio.h>
int halffind(int a[], int n, int key)
{
    int low = 0;
    int high = n - 1;
    while(low<= high){
        int mid = (low + high)/2;
        int mids = a[mid];
        if(mids<key)
           {
               low = mid + 1;
           }
        else if(mids>key)
           {
               high = mid - 1;
           }
        else
           {

            return mid;
    }
    }
    return -1;
}
int main()
{
    int i, n, ret;
    int key=0;
    int arr[9999]={0};
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
        scanf("%d",&arr[i]);
    }
   scanf("%d",&key);
    ret = halffind(arr,n,key);
    if(-1 == ret)
        {
            printf("Value not found");
            }
    else

        {

            printf ("Found value at index %d",ret);
        }
    return 0;
}



